package roborally.program.command;

import be.kuleuven.cs.som.annotate.Basic;
import be.kuleuven.cs.som.annotate.Immutable;

/**
 * A class representing a FlowCommand that has a condition that determines which commands are executed.
 * Examples are the while-statement and the if-then-else-then-statement.
 * 
 * @author Molderez Tom, 2de bach Ingenieurswetenschappen Computerwetenschappen-Elektrotechniek and Reniers Jorn, 2de bach Ingenieurswetenschappen Werktuigkunde-Computerwetenschappen
 * @version 1.0
 *
 */
public abstract class ConditionalCommand extends FlowCommand {
	
	/**
	 * Creates a new ConditionalCommand.
	 * 
	 */
	protected ConditionalCommand(Condition condition){
		super();
		this.condition = condition;
	}
	
	/**
	 * Returns the condition that determines which statements of the internal commands are executed.
	 */
	@Basic @Immutable
	public Condition getCondition(){
		return condition;
	}

	private final Condition condition;
}
